<?php
/**
 * Goods.php
* 跨境电商商城系统
 * =============================================
 * Copy right 2016-2026 大连熠泽科技网络有限公司
 * ---------------------------------------------
 * 官方网址: http://www.yizehuitong.com
 * =============================================
 * @author : yizehuitong
 * @date : 2019.10
 * @version : v2.0
 */

namespace addons\NsCardGoods\admin\controller;

use app\admin\controller\BaseController;
use data\service\Goods as GoodsService;

/**
 * 商品控制器
 */
class Goods extends BaseController
{
	public $addon_view_path;
	
	public function __construct()
	{
		parent::__construct();
		$this->addon_view_path = ADDON_DIR . '/NsCardGoods/template/';
	}
	
	/**
	 * 添加商品
	 */
	public function addGoods()
	{
		return view($this->addon_view_path . $this->style . "Goods/editGoods.html");
	}
	
	/**
	 * 编辑商品
	 */
	public function editGoods($goods_id)
	{
		return view($this->addon_view_path . $this->style . "Goods/editGoods.html");
	}
	
	/**
	 * 回收站商品恢复
	 */
	public function regainGoodsDeleted()
	{
		if (request()->isAjax()) {
			$goods_ids = request()->post('goods_ids');
			$goods = new GoodsService();
			$res = $goods->regainGoodsDeleted($goods_ids);
			return AjaxReturn($res);
		}
	}
	
	/**
	 * 虚拟商品管理
	 */
	public function virtualGoodsManage()
	{
		return view($this->addon_view_path . $this->style . "Goods/virtualGoodsManage.html");
	}
}